<template>
  <el-container class="all">
    <el-header>
      中国青年志愿网 上海海洋大学社会实践平台
      <div class="quit">
        <el-avatar
          style="position:relative;top:8px"
          :size="30"
          :src="circleUrl"
        ></el-avatar>
        <span>你好</span> {{ this.$route.query.student_name }}
        <span @click="quit" style="color:#e25b5b">退出</span>
      </div>
    </el-header>

    <el-container>
      <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
        <el-menu :default-openeds="[]" @select="menuclick">
          <el-submenu index="1">
            <template slot="title"
              ><i class="el-icon-bicycle"></i>社会实践</template
            >
            <el-menu-item-group>
              <el-menu-item index="AllLook">查看所有实践</el-menu-item>
              <el-menu-item index="StudentInsert">添加实践任务</el-menu-item>
              <el-menu-item index="StudentDelete">删除实践任务</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="2">
            <template slot="title"
              ><i class="el-icon-user"></i>我的实践</template
            >
            <el-menu-item-group>
              <el-menu-item index="StudentLook">已添加的实践</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="3">
            <template slot="title"
              ><i class="el-icon-setting"></i>我的信息</template
            >
            <el-menu-item-group>
              <el-menu-item index="StudentInfo">查看个人信息</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
      </el-aside>
      <el-container>
        <el-main>
          <router-view />
        </el-main>
      </el-container>
    </el-container>

    <el-footer>开发人员：谢海杰1951316、温天悦1951337、龚殿尊1951336</el-footer>
  </el-container>
</template>

<script>
export default {
  data() {
    return {
      circleUrl:
        "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png"
    };
  },
  created(){
      this.router.push({
        path: `/AllLook`,
        query: { student_name: this.$route.query.student_name }
      });
  },
  methods: {
    quit() {
      this.router.push("/");
      sessionStorage.clear();
    },
    menuclick(index) {
      this.router.push({
        path: `/${index}`,
        query: { student_name: this.$route.query.student_name }
      });
    }
  }
};
</script>

<style>
* {
  padding: 0;
  margin: 0;
}
.quit {
  float: right;
  font-size: 13px;
  color: #333;
}
.quit span {
  margin-left: 16px;
  font-size: 13px;
  color: #999;
  cursor: pointer;
}
.all {
  height: 100%;
}
.el-header,
.el-footer {
  background-color: #b3c0d1;
  color: #333;
  line-height: 60px;
  height: 150px;
  text-align: center;
  font-size: 30px;
  color: gray;
}

.el-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
  line-height: 60px;
}

body > .el-container {
  margin-bottom: 40px;
}

</style>
